package cn.wolfcode.luowowo.flight.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class FlightQueryObject extends QueryObject {

    private Integer order=0;//是否热门
    private Integer hot = 1;//是否热门

    private String orgCity; //出发城市

    private String dstCity; //到达城市
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date time; //开始时间


    public String getOrders(){
        if(order == 0){
            return "order by arrTime asc , depTime asc";
        }
        return "order by arrTime des , depTime des";
    }
}
